<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>


<?php
 $usuario = $_POST['user_div_field'];
 $senha=$_POST['pwd_div_field'];

require 'action/userAction.php';

if($resultado && $senha == $resultado->getPassword()) {
  
 session_start();
 $_SESSION['user']=$resultado->getUser();
 $_SESSION['password']=$resultado->getPassword();
 $_SESSION['userId']=$resultado->getId();
 
 
 header("Location: index.php");
 

} else {
header("Location: login.php?login=falhou&causa=".urlencode('User Inválido'));
exit;
}


?>

</body>
</html>